<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		*{
			margin: 0;
			padding: 0;
		}
		.box{
			width: 328px;
			height: 522px;
			background: #2376bc;
			margin: 0 auto;
			overflow: hidden;
		}
		form{
			width: 300px;
			height: 500px;
			margin-left: 14px;
			background: white;
			margin-top: 10px;
			overflow: hidden;
		}
		form p{
			text-align: center;
			font-size: 20px;
			font-weight: bolder;
			color: #888888;
			margin-top: 10px;
		}
		.p2{
			font-size: 12px;
			font-weight: normal;
		}
		input{
			width: 240px;
			height: 46px;
			border: none;
			border: 1px #888888 solid;
			padding-left: 20px;
			margin-left: 20px;
			margin-top: 13px;
			line-height: 46px;
		}
        .sub{
        	background: #2376bc;
        	color: #fff;
        	width: 260px;
        	text-align: center;
        	line-height: 46px;
        	padding: 0;
        	font-weight: bolder;
        }
        .p3{
        	font-size: 14px;
        	margin-top: 50px;
        	font-weight: normal;
        }
        .txt{
        	margin-top: 30px;
        }

	</style>
</head>
<body>
	<div class="box">
		<form action="">
			<p>日考测试</p>
			<p class="p2">对新增元素，新增属性的案例</p>
			<input id="in1" type="text" placeholder="请输入用户名" class="txt"><br>
			<input id="in2" type="email" placeholder="请输入你的邮箱地址"><br>
			<input id="in3" type="number" placeholder="请输入你的真实年龄"><br>
			<input id="in4" type="date"><br>
			<input id="in5" type="submit" value="提交" class="sub">
			<p class="p3">已有账号<a href="">登录</a></p>
		</form>
	</div>
</body>
<script>
	function $$(str){
         
         return document.getElementById(str)
	}
    var in1=$$('in1')
    var in2=$$('in2')
    var in3=$$('in3')
    var in4=$$('in4')
    var in5=$$('in5')
    in5.onclick=function(e){
    	e.preventDefault();
    	console.log(in1.value,in2.value,in3.value,in4.value)
    
    	localStorage.setItem("姓名",in1.value);
    	localStorage.setItem("邮箱",in2.value);
    	localStorage.setItem("年龄",in3.value);
    	localStorage.setItem("日期",in4.value);

        
    }
   


</script>
</html>